#pragma once
#include "log/channel.hpp"
#include "log/message.hpp"
#include "event/mutex.hpp"
using JHCPP::event::CMutex;
#include <string>
#include <vector>

namespace JHCPP
{
	namespace log
	{
		class CSplitterChannel: public CChannel
		{
		public:
			CSplitterChannel();

			void addChannel(CChannel* pChannel);
			void removeChannel(CChannel* pChannel);

			void log(const CMessage& msg);

			void setProperty(const std::string& name, const std::string& value);

			void close();

			int count() const;
	
		protected:
			~CSplitterChannel();

		private:
			typedef std::vector<CChannel*> ChannelVec;

			ChannelVec		m_channels;
			mutable CMutex	m_mutex;
		};

	}//end of namespace log
}//end of namespace JHCPP
